<template>
	<view>
		<!-- <map style="width: 750rpx;"></map> -->
		<view class="">
			<view class="list" @click="month">点击考评</view>
			
			<!-- <view class="list" @click="season">村屯考评</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				testList: [],
				data: '',
				localdata: [
					{
						text: 'jj',
						value: 6,
					},
					{
					text: 'yaso',
					value: 1,
					children: [
						{
							text: 'e',
							value: 2,
						},
						{
							text: 'q',
							value: 3,
							children: [
								{
									text: 'eq',
									value: 4,
								},
								{
									text: 'eqr',
									value: 5,
								}
							]
						}
					]
				}]
			}
		},
		mounted() {
			this.getList()
			
		},
		// onShow: function(){
			
		// },
		methods: {
			// tcvr(e){
			// 	uni.navigateTo({
			// 		console.log(e)
			// 		url: this.urllist[e]
			// 	})
			// }
			getList() {
				var list = [{name: '张珊', id: 1}, {name: '王五', id: 2}]
				this.testList = list
			},
			test() {
				console.log(this.testList[0].id)
			},
			changePicker(e) {
				console.log(e);
			},
			month(){
				console.log('点击了')
				uni.navigateTo({
					url:'../month/month'
				})
			},
			season(){
				console.log('点击了')
				uni.navigateTo({
					url:'../season/season'
				})
			},
			halfyear(){
				console.log('点击了')
				uni.navigateTo({
					url:'../halfyear/halfyear'
				})
			},
			wholeyear(){
				console.log('点击了')
				uni.navigateTo({
					url:'../wholeyear/wholeyear'
				})
			},
			rule(){
				console.log('点击了')
				uni.navigateTo({
					url:'../rule/rule'
				})
			},
			jdli(){
				console.log('点击了')
				uni.navigateTo({
					url:'../jdli/jdli'
				})
			},
			getdw(){
				 
				      let that = this
				      // 获取用户是否开启 授权获取当前的地理位置、速度的权限。
				      uni.getSetting({
				        success (res) {
				          console.log(res)
				
				          // 如果没有授权
				          if (!res.authSetting['scope.userLocation']) {
				            // 则拉起授权窗口
				            uni.authorize({
				              scope: 'scope.userLocation',
				              success () {
				                //点击允许后--就一直会进入成功授权的回调 就可以使用获取的方法了
				                uni.getLocation({
				                  type: 'wgs84',
				                  success: function (res) {
				                    that.x = res.longitude
				                    that.y = res.latitude
				                    console.log(res)
				                    console.log('当前位置的经度：' + res.longitude)
				                    console.log('当前位置的纬度：' + res.latitude)
				                    uni.showToast({
				                      title: '当前位置的经纬度：' + res.longitude + ',' + res.latitude,
				                      icon: 'success',
				                      mask: true
				                    })
				                  }, fail (error) {
				                    console.log('失败', error)
				                  }
				                })
				              },
				              fail (error) {
				                //点击了拒绝授权后--就一直会进入失败回调函数--此时就可以在这里重新拉起授权窗口
				                console.log('拒绝授权', error)
				
				                uni.showModal({
				                  title: '提示',
				                  content: '若点击不授权，将无法使用位置功能',
				                  cancelText: '不授权',
				                  cancelColor: '#999',
				                  confirmText: '授权',
				                  confirmColor: '#f94218',
				                  success (res) {
				                    console.log(res)
				                    if (res.confirm) {
				                      // 选择弹框内授权
				                      uni.openSetting({
				                        success (res) {
				                          console.log(res.authSetting)
				                        }
				                      })
				                    } else if (res.cancel) {
				                      // 选择弹框内 不授权
				                      console.log('用户点击不授权')
				                    }
				                  }
				                })
				              }
				            })
				          } else {
				            // 有权限则直接获取
				            uni.getLocation({
				              type: 'wgs84',
				              success: function (res) {
				                that.x = res.longitude
				                that.y = res.latitude
				                console.log(res)
				                console.log('当前位置的经度：' + res.longitude)
				                console.log('当前位置的纬度：' + res.latitude)
				                uni.showToast({
				                  title: '当前位置的经纬度：' + res.longitude + ',' + res.latitude,
				                  icon: 'success',
				                  mask: true
				                })
				              }, fail (error) {
				                uni.showToast({
				                  title: '请勿频繁调用！',
				                  icon: 'none',
				                })
				                console.log('失败', error)
				              }
				            })
				          }
				        }
				      })
				
				    
				// uni.authorize({
				// 	scope:['scope.userInfo','scope.userLocation','scope.userLocationBackground'],
				// 	success:(res) => {
				// 		uni.getLocation({
				// 			success:(res) => {
				// 				console.log(res)
				// 			}
				// 		})
				// 	}
				// })
			}
		}
	}
</script>

<style>
	.first {
		text-align: center;
		font-size: 40rpx;
		color: royalblue;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
	.list{
		width: 160rpx;
		height: 120rpx;
		text-align: center;
		line-height: 120rpx;
		background-color: pink;
		margin: 0 auto;
		margin-top: 150rpx;
	}
</style>